﻿Public Class Files
    Public Sub associateFile(ByVal mainKey As String, ByVal ext As String, ByVal iconPath As String, ByVal fileDescription As String, ByVal appPath As String)
        My.Computer.Registry.ClassesRoot.CreateSubKey(ext).SetValue("", mainKey, Microsoft.Win32.RegistryValueKind.String)
        My.Computer.Registry.ClassesRoot.CreateSubKey(mainKey).SetValue("", fileDescription, Microsoft.Win32.RegistryValueKind.String)
        My.Computer.Registry.ClassesRoot.CreateSubKey(mainKey & "\shell\open\command").SetValue("", appPath & " ""%l"" ", Microsoft.Win32.RegistryValueKind.String)
        My.Computer.Registry.ClassesRoot.CreateSubKey(mainKey & "\DefaultIcon").SetValue("", iconPath, Microsoft.Win32.RegistryValueKind.ExpandString)
    End Sub
    Public Sub SetFileAssociations()
        associateFile("UCS Plugin", ".ucp", "C:\universal-control-framework\System\Lib\UCFBase.dll,0", "Universal Control Framework Plugin", "C:\universal-control-framework\System\UCFMain.exe")
    End Sub
End Class
